.remote
  = simple_form_for(@lead, html: one_submit_only, remote: true) do |f|
    = link_to_close edit_lead_path(@lead)
    = f.hidden_field :user_id

    = f.error_messages object_name: t('lead')

    = render "leads/top_section",    f: f, edit: true
    = render "fields/edit_custom_field_group", f: f, edit: true
    = render "leads/status",         f: f, edit: true
    = render "leads/contact",        f: f, edit: true
    = render "leads/web",            f: f, edit: true
    = render "fields/groups",        f: f, edit: true
    = render "entities/permissions", f: f, edit: true, entity: @lead
    = hook(:entity_form, self, {f: f, entity: @lead})

    .buttonbar
      - if Setting.compound_address
        = f.submit t(:save_lead), onclick: "crm.clear_all_hints()"
      - else
        = f.submit t(:save_lead)
      #{t :or}
      = link_to_cancel edit_lead_path(@lead)
